Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

363
Visualizações
Url redirects you too many times using Cypress Invoke("removeAttr", "target") command

I'm using this code to handle new tab and getting this error. It's displaying chrome-error //chromewebdata/ in url.

Tried for few other example site and it's working fine. I think mine url is redirecting two times that why facing this issue "redirected too many time". How I can handle it?

cy.get(".store-list-item__action").contains("a","Log in").eq(0).invoke("removeAttr", 'target').then(newUrl=>{
        cy.wrap(newUrl).click()
    })

enter image description here

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

How about you just use this:

cy.contains('a', 'Log in').invoke("removeAttr", 'target').click()
about 4 years ago · Juan Pablo Isaza Relatório

0

.invoke("removeAttr", 'target')

Above Command will work only if system is moving user to same "href" link, in this case after clicking the link systemis redirecting user to another page/link which cypress doesn't support. So cy.request() method can be used for this scenario to validate data.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda